#include "Precompiled.h"
#include "SceneRender.h"

#include "../Common/Scene.h"
#include "../Common/EntityRenderPair.h"

namespace Game {
namespace Render {

SceneRender::SceneRender() {
}

SceneRender::~SceneRender() {
}

const RTTI& SceneRender::GetEntityRTTI() const {
    return Scene::rtti;
}

void SceneRender::Draw(DrawableEntity* drawableEntity, const float& elapsedTime) {
    Scene* scene = static_cast<Scene*>(drawableEntity);
    CollectionIterator<EntityRenderPair*> it(scene->GetEntityRender());
    for (; it(); ++it) {
        EntityRenderPair* pair = *it;
        if (pair->GetDrawableEntity()->GetVisible()) {
            pair->Draw(elapsedTime);
        }
    }
}

}
}